﻿<%@ Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="~/Site.Master" CodeBehind="Photodetail.aspx.vb" Inherits="MyProject.WebForm4" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <br />
    <asp:ListView ID="ListView1" runat="server" DataKeyNames="ID" 
        DataSourceID="AccessDataSource1" GroupItemCount="3">
        <AlternatingItemTemplate>
             <td id="Td1" runat="server" style="background-color:#e73216;color: #000000;">
                                <br /><b>Title:</b>
                <asp:Label ID="ItemNameLabel" runat="server" Text='<%# Eval("ItemName") %>' />
                <br /><b>Description:</b>
                <asp:Label ID="DescriptionLabel" runat="server" 
                    Text='<%# Eval("Description") %>' />
                    <br /><b>URL:</b>
                <asp:Label ID="URLLabel" runat="server" Text='<%# Eval("URL") %>' />
                
                                             <br /><b>Author:</b>
                <asp:Label ID="AuthorLabel" runat="server" Text='<%# Eval("Author") %>' />
                <br />
                <img src = '<%#eval("file")%>' alt="*" width="750" height="750" /> 
                
                <br />
            </td>
        </AlternatingItemTemplate>
        <EditItemTemplate>
            <td runat="server" style="background-color:#008A8C;color: #FFFFFF;">
                ID:
                <asp:Label ID="IDLabel1" runat="server" Text='<%# Eval("ID") %>' />
                <br />ItemName:
                <asp:TextBox ID="ItemNameTextBox" runat="server" 
                    Text='<%# Bind("ItemName") %>' />
                <br />Description:
                <asp:TextBox ID="DescriptionTextBox" runat="server" 
                    Text='<%# Bind("Description") %>' />
                <br />File:
                <asp:TextBox ID="FileTextBox" runat="server" Text='<%# Bind("File") %>' />
                <br />URL:
                <asp:TextBox ID="URLTextBox" runat="server" Text='<%# Bind("URL") %>' />
                <br />Author:
                <asp:TextBox ID="AuthorTextBox" runat="server" Text='<%# Bind("Author") %>' />
                <br />
                <asp:Button ID="UpdateButton" runat="server" CommandName="Update" 
                    Text="Update" />
                <br />
                <asp:Button ID="CancelButton" runat="server" CommandName="Cancel" 
                    Text="Cancel" />
                <br />
            </td>
        </EditItemTemplate>
        <EmptyDataTemplate>
            <table runat="server" 
                style="background-color: #FFFFFF;border-collapse: collapse;border-color: #999999;border-style:none;border-width:1px;">
                <tr>
                    <td>
                        No data was returned.</td>
                </tr>
            </table>
        </EmptyDataTemplate>
        <EmptyItemTemplate>
<td runat="server" />
        </EmptyItemTemplate>
        <GroupTemplate>
            <tr ID="itemPlaceholderContainer" runat="server">
                <td ID="itemPlaceholder" runat="server">
                </td>
            </tr>
        </GroupTemplate>
        <InsertItemTemplate>
            <td runat="server" style="">
                ItemName:
                <asp:TextBox ID="ItemNameTextBox" runat="server" 
                    Text='<%# Bind("ItemName") %>' />
                <br />Description:
                <asp:TextBox ID="DescriptionTextBox" runat="server" 
                    Text='<%# Bind("Description") %>' />
                <br />File:
                <asp:TextBox ID="FileTextBox" runat="server" Text='<%# Bind("File") %>' />
                <br />URL:
                <asp:TextBox ID="URLTextBox" runat="server" Text='<%# Bind("URL") %>' />
                <br />Author:
                <asp:TextBox ID="AuthorTextBox" runat="server" Text='<%# Bind("Author") %>' />
                <br />
                <asp:Button ID="InsertButton" runat="server" CommandName="Insert" 
                    Text="Insert" />
                <br />
                <asp:Button ID="CancelButton" runat="server" CommandName="Cancel" 
                    Text="Clear" />
                <br />
            </td>
        </InsertItemTemplate>
        <ItemTemplate>
            <td runat="server" style="background-color:#e73216;color: #000000;">
                                <br /><b>Title:</b>
                <asp:Label ID="ItemNameLabel" runat="server" Text='<%# Eval("ItemName") %>' />
                <br /><b>Description:</b>
                <asp:Label ID="DescriptionLabel" runat="server" 
                    Text='<%# Eval("Description") %>' />
                    <br /><b>URL:</b>
                <asp:Label ID="URLLabel" runat="server" Text='<%# Eval("URL") %>' />
                
                                             <br /><b>Author:</b>
                <asp:Label ID="AuthorLabel" runat="server" Text='<%# Eval("Author") %>' />
                <br />
                <img src = '<%#eval("file")%>' alt="*" width="750" height="750" /> 
                
                <br />
            </td>
        </ItemTemplate>
        <LayoutTemplate>
            <table runat="server">
                <tr runat="server">
                    <td runat="server">
                        <table ID="groupPlaceholderContainer" runat="server" border="1" 
                            style="background-color: #FFFFFF;border-collapse: collapse;border-color: #999999;border-style:none;border-width:1px;font-family: Verdana, Arial, Helvetica, sans-serif;">
                            <tr ID="groupPlaceholder" runat="server">
                            </tr>
                        </table>
                    </td>
                </tr>
                <tr runat="server">
                    <td runat="server" 
                        style="text-align: center;background-color: #CCCCCC;font-family: Verdana, Arial, Helvetica, sans-serif;color: #000000;">
                    </td>
                </tr>
            </table>
        </LayoutTemplate>
        <SelectedItemTemplate>
            <td runat="server" 
                style="background-color:#008A8C;font-weight: bold;color: #FFFFFF;">
                ID:
                <asp:Label ID="IDLabel" runat="server" Text='<%# Eval("ID") %>' />
                <br />ItemName:
                <asp:Label ID="ItemNameLabel" runat="server" Text='<%# Eval("ItemName") %>' />
                <br />Description:
                <asp:Label ID="DescriptionLabel" runat="server" 
                    Text='<%# Eval("Description") %>' />
                <br />File:
                <asp:Label ID="FileLabel" runat="server" Text='<%# Eval("File") %>' />
                <br />URL:
                <asp:Label ID="URLLabel" runat="server" Text='<%# Eval("URL") %>' />
                <br />Author:
                <asp:Label ID="AuthorLabel" runat="server" Text='<%# Eval("Author") %>' />
                <br />
            </td>
        </SelectedItemTemplate>
    </asp:ListView>
    <asp:AccessDataSource ID="AccessDataSource1" runat="server" 
        DataFile="~/App_Data/AssignmentDB.accdb" 
        SelectCommand="SELECT [ID], [ItemName], [Description], [File], [URL], [Author] FROM [Item] WHERE ([ID] = ?)">
        <SelectParameters>
            <asp:QueryStringParameter Name="ID" QueryStringField="ID" Type="Int32" />
        </SelectParameters>
    </asp:AccessDataSource>
    <br />
    <asp:GridView ID="GridView2" runat="server" AutoGenerateColumns="False" 
        DataSourceID="AccessDataSource2" CellPadding="4" ForeColor="#333333" 
    GridLines="None">
        <AlternatingRowStyle BackColor="White" />
        <Columns>
            <asp:BoundField DataField="Comment" HeaderText="Comment" 
                SortExpression="Comment" />
                   <asp:BoundField DataField="Author" HeaderText="Author" 
                SortExpression="Author" />
                   </Columns>
        <FooterStyle BackColor="#990000" Font-Bold="True" ForeColor="White" />
        <HeaderStyle BackColor="#990000" Font-Bold="True" ForeColor="White" />
        <PagerStyle BackColor="#FFCC66" ForeColor="#333333" HorizontalAlign="Center" />
        <RowStyle BackColor="#FFFBD6" ForeColor="#333333" />
        <SelectedRowStyle BackColor="#FFCC66" Font-Bold="True" ForeColor="Navy" />
        <SortedAscendingCellStyle BackColor="#FDF5AC" />
        <SortedAscendingHeaderStyle BackColor="#4D0000" />
        <SortedDescendingCellStyle BackColor="#FCF6C0" />
        <SortedDescendingHeaderStyle BackColor="#820000" />
    </asp:GridView>
    <asp:AccessDataSource ID="AccessDataSource2" runat="server" 
        DataFile="~/App_Data/AssignmentDB.accdb" 
        
    SelectCommand="SELECT [Comment], [Author] FROM [Comment] WHERE ([ItemFK] = ?)">
        <SelectParameters>
            <asp:QueryStringParameter Name="ItemFK" QueryStringField="ID" Type="Int32" />
        </SelectParameters>
    </asp:AccessDataSource>
    <br />
    <br />
    Add a Comment here <asp:LoginName ID="LoginName1" runat="server" />
    <br />
    <br />
    <asp:TextBox ID="TB_Comment" runat="server" Height="108px" Width="295px" 
    BorderColor="Red" BorderStyle="Solid" BorderWidth="1px"></asp:TextBox>
    <br />
    <br />
&nbsp;&nbsp;
    <asp:Button ID="BT_Comments" runat="server" Text="Add Comment" />
    <br />
<br />
Select an exiting tag or enter a new tag (or multiple tags separated by commas)<br />
    <br />
    <asp:CheckBoxList ID="CheckBoxList1" runat="server" 
        DataSourceID="AccessDataSource3" DataTextField="Tag" 
    DataValueField="ID" BorderColor="Red" BorderStyle="Solid" BorderWidth="1px" 
    RepeatDirection="Horizontal">
    </asp:CheckBoxList>
    <asp:AccessDataSource ID="AccessDataSource3" runat="server" 
        DataFile="~/App_Data/AssignmentDB.accdb" 
        SelectCommand="SELECT [Tag], [ID] FROM [Tag]"></asp:AccessDataSource>
    <br />
    <asp:TextBox ID="TB_Addtag" runat="server" BorderColor="Red" 
    BorderStyle="Solid" BorderWidth="1px"></asp:TextBox>
    <br />
    <br />
    &nbsp;&nbsp;
    <asp:Button ID="BT_AddTag" runat="server" Text="Add Tag" />
    <br />
</asp:Content>
